﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

namespace _8Exercise
{
    class Program
    {
        static void Main(string[] args)
        {
            string text = "We are living in a yellow submarine. We don't have anything else. Inside the submarine is very tight. So we are drinking all the day. We will move out of it in 5 days.";
            MatchCollection sentence = Regex.Matches(text, @"\s*(?<name>[^\.]*?\bin\b.*?\.)");
            foreach (Match item in sentence)
            {
                Console.WriteLine(item.Groups["name"]);
            }
        }
    }
}
